﻿using System;

namespace DBMock
{
    /// <summary>
    /// 单元格builder抽象类
    /// </summary>
    public abstract class Builder
    {
        //随机数生成器
        protected Random random;

        /// <summary>
        /// 空值概率
        /// </summary>
        public int NullPercent { get; set; }

        /// <summary>
        /// 初始化builder
        /// </summary>
        /// <param name="seed">随机数生成器种子</param>
        public Builder(int seed)
        {
            random = new Random(seed);
        }

        /// <summary>
        /// 更新随机数生成器
        /// </summary>
        /// <param name="seed">种子</param>
        public void NewRandom(int seed)
        {
            random = new Random(seed);
        }

        /// <summary>
        /// 单元格Build抽象方法
        /// </summary>
        /// <returns></returns>
        public abstract object Build();
    }
}
